#include <iostream>
#include <cstdio>

using namespace std; 

#define N	100001
#define M	100003

int a[N]; 
int n, k; 

int main()
{
	int i, j; 
	
	//freopen("p1192.in", "r", stdin);  
	cin>>n>>k; 
	
	a[0] = 1; 
	for (i=0; i<n; i++) {
		for (j=1; j<=k; j++) {
			if (i+j>n)
				break; 
			//printf("  a[%d+%d](%d) += a[%d](%d) = %d\n", i, j, a[i+j], i, a[j], a[i+j]+a[i]); 
			a[i+j] += a[i]; 
			a[i+j] %= M; 
		}
		//printf("a[%d] = %d\n", i, a[i]); 
	}
	
	cout<<a[n]<<endl; 
	return 0; 
}


